home *** CD-ROM | disk | FTP | other *** search
- '------------------------------------------------------------------------------
- '------------------------------------------------------------------------------
- '--
- '-- Visio Mouse Utilities
- '-- (C)1993 Shapeware Corporation
- '--
- '-- File Name : vismouse.bas
- '--
- '-- Description :
- '--
- '------------------------------------------------------------------------------
- '------------------------------------------------------------------------------
-
- 'This file contains sample code for using Visual Basic and OLE 2.0 to
- 'automatically create a Visio network diagram from a Microsoft Access
- 'database.
- '
- 'IMPORTANT: NETVB.ZIP is ONLY a sample, not a released product. It was
- 'not extensively tested, and has no guarantee. In addition, we do not provide
- 'documentation or support for this file.
-
- Option Explicit
-
- '--
- '-- SetHourGlass action constants
- '--
-
- Global Const MP_WAIT = 1
- Global Const MP_NORMAL = 2
- Global Const MP_RESTORE = 3
-
- Sub BeginWaitPointer ()
- '----------------------------------------
- '--- BeginWaitPointer -------------------
- '--
- '-- Use this procedure in conjunction with EndWaitPointer to toggle the mouse
- '-- pointer between an hourglass, wait mode, and a regular pointer.
- '--
-
- Screen.MousePointer = 11 '-- Set To Hourglass Pointer
- End Sub
-
- Sub EndWaitPointer ()
- '----------------------------------------
- '--- EndWaitPointer ---------------------
- '--
- '-- Use this procedure in conjunction with BeginWaitPointer to toggle the mouse
- '-- pointer between an hourglass, wait mode, and a regular pointer.
- '--
-
- Screen.MousePointer = 0 '-- Set To Default Mouse Pointer
- End Sub
-
- Sub SetMousePointer (iType As Integer)
- '----------------------------------------
- '--- SetMousePointer --------------------
- '--
- '-- Manages multiple requests for the hour glass pointer. Passing MP_WAIT
- '-- not only changes the pointer to an hourglass, it increments the count of
- '-- requests for it. MP_NORMAL will decrement it and only when it returns
- '-- to zero does the cursor change back to it's default pointer. Multiple
- '-- procedures can ask for an hourglass this way without overrunning each other.
- '--
- '-- Parameters : iType - MP_WAIT Changes mouse pointer to hourglass if not
- '-- already.
- '-- MP_NORMAL Decrements the hourglass count and, if 0,
- '-- restores the pointer to it's default.
- '-- MP_RESTORE Clears the hourglass count and restores
- '-- the pointer to it's default.
- '--
-
- Static iWaitCount As Integer
-
- Select Case iType
- Case MP_WAIT
- iWaitCount = iWaitCount + 1
- Screen.MousePointer = 11
- Case MP_NORMAL
- If iWaitCount > 0 Then
- iWaitCount = iWaitCount - 1
-
- If iWaitCount = 0 Then Screen.MousePointer = 0
- End If
- Case MP_RESTORE
- iWaitCount = 0
- Screen.MousePointer = 0
- End Select
- End Sub
-
-